package com.he.demo.yyt.zy;

import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * @author heyanjing
 * date:2022-04-18 2022/4/18:11:39
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WsZyPatient {
    private String ID_NO;
    private String TREATMENT_CARDNUM;
    private String WARD_CODE;
    private String NURSING_CLASS_CODE;
    private String DEPT_NAME;
    private String RELATIONSHIP_CODE;
    private String CHARGE_TYPE_NAME;
    private String SEX;
    private String DUTY_NURSE_ID;
    private String MARRIAGE;
    private String ADMISSION_DATE_TIME;
    private String SUPER_DOCTOR_NAME;
    private String ID_TYPE;
    private String NAME_PHONETIC;
    private String DUTY_NURSE_NAME;
    private String RFID_UID;
    private String NATION;
    private String BED_NO;
    private String CITIZENSHIP;
    private String ABOBLOOD_TYPE;
    private String Bed_Label;
    private String ADM_WARD_DATE_TIME;
    private String NURSING_CLASS_NAME;
    private String Danger;
    private String PATIENT_CLASS_CODE;
    private String BIH_NO;
    private String BIRTH_PLACE;
    private String DATE_OF_BIRTH;
    private String MAIN_DOCTOR_NAME;
    private String DIAGNOSIS;
    private String MAIN_DOCTOR_ID;
    private String DEPT_CODE;
    private String RELATIONSHIP_NAME;
    private String TOTAL_COSTS;
    private String NEXT_OF_KIN_PHONE;
    private String MAILING_ADDRESS;
    private String NAME;
    private String PREPAYMENTS;
    private String OPERATING_DATE;
    private String PATIENT_CLASS_NAME;
    private String PARENT_DOCTOR_ID;
    private String SUPER_DOCTOR_ID;
    private String OCCUPATION;
    private String PATIENT_CONDITION;
    private String PATIENT_ID;
    private String WARD_NAME;
    private String NEXT_OF_KIN;

    public InPatient toInpatient(){
        InPatient p=new InPatient();
        p.setPatient_id(PATIENT_ID);
        p.setSeries("1");
        p.setAdmission_id(BIH_NO);
        p.setPatient_name(NAME);
        p.setIdno_type(ID_TYPE);
        p.setIdno(ID_NO);
        p.setMarriage(MARRIAGE);
        p.setSex(SEX);
        p.setDept_code(DEPT_CODE);
        p.setDept_name(DEPT_NAME);
        p.setWard_code(WARD_CODE);
        p.setWard_name(WARD_NAME);
        p.setBed_no(BED_NO);
        p.setDate_birth(DATE_OF_BIRTH);
        if(StringUtils.isNotBlank(DATE_OF_BIRTH)){
            p.setAge(DateUtil.betweenYear(DateUtil.parseDate(DATE_OF_BIRTH),new Date(),false)+"");
        }
        p.setAddress(MAILING_ADDRESS);
        p.setJob(OCCUPATION);
        p.setCountry(CITIZENSHIP);
        p.setNation(NATION);
        p.setAdmission_time(ADMISSION_DATE_TIME);
        p.setAdmission_ward_time(ADM_WARD_DATE_TIME);
        p.setNursing_class(NURSING_CLASS_NAME);
        p.setDoctor(MAIN_DOCTOR_NAME);
        p.setDiagnosis(DIAGNOSIS);
        p.setPatient_condition(PATIENT_CONDITION);
        p.setContact_name(NEXT_OF_KIN);
        p.setContact_phone(NEXT_OF_KIN_PHONE);


        p.setRisk_max_rank("");
        p.setNode_type("");
        p.setHome_address("");
        p.setContact_info("");
        p.setWeight("");
        p.setHeight("");
        p.setDischarge_time("");
        p.setInout_status("");
        p.setContact_rela("");
        p.setContact_idno("");
        p.setContact_address("");
        p.setEducation("");
        p.setFenmian_riqi("");
        p.setFenmian_fangshi("");
        p.setGaowei("");
        p.setWm_id(0);
        return p;
    }
}
